package com.polaris.live.ui.me

import android.os.Bundle
import androidx.fragment.app.Fragment
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.polaris.live.common.adapter.ViewPagerAdapter
import com.polaris.live.common.ext.setOnSingleClickListener
import com.polaris.live.common.mvvm.base2.BaseVbActivity
import com.polaris.live.common.mvvm.viewmodel.BaseViewModel
import com.polaris.live.databinding.ActivityMyInviteRewardBinding
import com.polaris.live.translation.R
import com.polaris.live.ui.me.invite_reward.MyInvitePeopleFragment
import com.polaris.live.ui.me.invite_reward.MyRewardFragment

/**
 * 我邀请的人和奖励
 *
 * @author Created by 半仙 on 2024/4/10/010 15:09
 */
class MyInviteRewardActivity : BaseVbActivity<BaseViewModel, ActivityMyInviteRewardBinding>() {
    override fun initView(savedInstanceState: Bundle?) {
        val tabs = mutableListOf<String>()
        tabs.add(getString(R.string.invitation_people))
        tabs.add(getString(R.string.rewards))
        val list = mutableListOf<Fragment>()
        list.add(MyInvitePeopleFragment())
        list.add(MyRewardFragment())
        mBinding.viewpager2.adapter = ViewPagerAdapter(list, this)
        TabLayoutMediator(
            mBinding.tab, mBinding.viewpager2
        ) { tab: TabLayout.Tab, p: Int ->
            tab.text = tabs[p]
        }.attach()

        initListener()
    }
    private fun initListener() {
        mBinding.acIvBack.setOnSingleClickListener {
            finish()
        }

    }

}